package com.see.config;
import com.see.controller.SseController;
import com.see.core.SseEmitterManager;
//import com.see.listener.SseTopicListener;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;


/**
 * SSE 自动装配
 *
 * @author Lion Li
 */
@Configuration
@ConditionalOnProperty(value = "sse.enabled", havingValue = "true")
@EnableConfigurationProperties(SseProperties.class)
public class SseAutoConfiguration {

    @Bean
    public SseEmitterManager sseEmitterManager() {
        return new SseEmitterManager();
    }

//    @Bean
//    public SseTopicListener sseTopicListener() {
//        return new SseTopicListener();
//    }

//    @Bean
//    public SseController sseController(SseEmitterManager sseEmitterManager) {
//        return new SseController(sseEmitterManager);
//    }

}
